package org.lanqiao.webfm.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;
import java.io.Serializable;
import java.sql.*;
import java.lang.reflect.*;

import javacommon.base.*;
import javacommon.ijdbc.*;
import javacommon.util.*;
import javacommon.web.page.*;

import org.lanqiao.webfm.model.*;

import org.slf4j.*;

/**
*@Author zhengwei
**/
public class Orders extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	//date formats
	public static final String FORMAT_EDATE = DATE_FORMAT;
	public static final String FORMAT_DEALDATE = DATE_FORMAT;
	//columns START
	/**id**/
	private Long id;
	/**用户**/
	private Long userId;
	/**发生日期**/
	private java.util.Date edate;
	private java.util.Date edateBegin;
	private java.util.Date edateEnd;
	/**地址**/
	private java.lang.String address;
	/**联系人**/
	private java.lang.String contactman;
	/**联系电话**/
	private java.lang.String phonenumber;
	/**邮编**/
	private java.lang.String postcode;
	/**总价**/
	private Long total;
	/**处理日期**/
	private java.util.Date dealdate;
	private java.util.Date dealdateBegin;
	private java.util.Date dealdateEnd;
	/**状态**/
	private java.lang.String status;
	/**备注**/
	private java.lang.String note;
	//columns END

	public Orders(){
	}

	public Orders(Long id){
		this.id = id;
	}

	public void setId(Long value) {
		this.id = value;
	}
	/**id**/
	public Long getId() {
		return this.id;
	}
	public void setUserId(Long value) {
		this.userId = value;
	}
	/**用户**/
	public Long getUserId() {
		return this.userId;
	}
	public String getEdateString() {
		return DateConvertUtils.format(getEdate(), FORMAT_EDATE);
	}
	public void setEdateString(String value) {
		setEdate(DateConvertUtils.parse(value, FORMAT_EDATE,java.util.Date.class));
	}
	public java.util.Date getEdateBegin() {
		return this.edateBegin;
	}
	
	public void setEdateBegin(java.util.Date value) {
		this.edateBegin = value;
	}	
	
	public java.util.Date getEdateEnd() {
		return this.edateEnd;
	}
	
	public void setEdateEnd(java.util.Date value) {
		this.edateEnd = value;
	}	
	public void setEdate(java.util.Date value) {
		this.edate = value;
	}
	/**发生日期**/
	public java.util.Date getEdate() {
		return this.edate;
	}
	public void setAddress(java.lang.String value) {
		this.address = value;
	}
	/**地址**/
	public java.lang.String getAddress() {
		return this.address;
	}
	public void setContactman(java.lang.String value) {
		this.contactman = value;
	}
	/**联系人**/
	public java.lang.String getContactman() {
		return this.contactman;
	}
	public void setPhonenumber(java.lang.String value) {
		this.phonenumber = value;
	}
	/**联系电话**/
	public java.lang.String getPhonenumber() {
		return this.phonenumber;
	}
	public void setPostcode(java.lang.String value) {
		this.postcode = value;
	}
	/**邮编**/
	public java.lang.String getPostcode() {
		return this.postcode;
	}
	public void setTotal(Long value) {
		this.total = value;
	}
	/**总价**/
	public Long getTotal() {
		return this.total;
	}
	public String getDealdateString() {
		return DateConvertUtils.format(getDealdate(), FORMAT_DEALDATE);
	}
	public void setDealdateString(String value) {
		setDealdate(DateConvertUtils.parse(value, FORMAT_DEALDATE,java.util.Date.class));
	}
	public java.util.Date getDealdateBegin() {
		return this.dealdateBegin;
	}
	
	public void setDealdateBegin(java.util.Date value) {
		this.dealdateBegin = value;
	}	
	
	public java.util.Date getDealdateEnd() {
		return this.dealdateEnd;
	}
	
	public void setDealdateEnd(java.util.Date value) {
		this.dealdateEnd = value;
	}	
	public void setDealdate(java.util.Date value) {
		this.dealdate = value;
	}
	/**处理日期**/
	public java.util.Date getDealdate() {
		return this.dealdate;
	}
	public void setStatus(java.lang.String value) {
		this.status = value;
	}
	/**状态**/
	public java.lang.String getStatus() {
		return this.status;
	}
	public void setNote(java.lang.String value) {
		this.note = value;
	}
	/**备注**/
	public java.lang.String getNote() {
		return this.note;
	}
	
	private Set ordersDetails = new HashSet(0);
	public void setOrdersDetails(Set ordersDetail){
		this.ordersDetails = ordersDetail;
	}
	
	public Set getOrdersDetails() {
		return ordersDetails;
	}
	
	private Userinfo userinfo;
	
	public void setUserinfo(Userinfo userinfo){
		this.userinfo = userinfo;
	}
	
	public Userinfo getUserinfo() {
		return userinfo;
	}
	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("UserId",getUserId())
			.append("Edate",getEdate())
			.append("Address",getAddress())
			.append("Contactman",getContactman())
			.append("Phonenumber",getPhonenumber())
			.append("Postcode",getPostcode())
			.append("Total",getTotal())
			.append("Dealdate",getDealdate())
			.append("Status",getStatus())
			.append("Note",getNote())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Orders == false) return false;
		if(this == obj) return true;
		Orders other = (Orders)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

